package com.ysk.testapplication;

import android.os.Bundle;
import android.view.View;


public class MainActivity extends BaseActivity {

  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
  }

  String img = "https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimg2.3lian.com%2F2014cf%2Ff2%2F59%2Fd%2F103.jpg&refer=http%3A%2F%2Fimg2.3lian.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1645864270&t=8a9939e646ca5df04f445bcccd9704e9";

  private volatile int size = 0;

  public void click(View view) {
    new Thread(() -> {
      while (size++ < 10000) {
        try {
          Thread.sleep(1);
        } catch (InterruptedException e) {
          e.printStackTrace();
        }
        setData2View(R.id.tv_test, "data:" + size);
      }
    }).start();
    setData2View(R.id.iv1, img);
    setData2View(R.id.fra, new TestFragment());
  }
}